package com.yyfax.pay.order.data.dao.protocol;

import org.apache.ibatis.annotations.Param;

import com.yyfax.pay.order.model.domain.ProtocolBindingOrderDO;

public interface ProtocolBindingOrderDao {
	/**
	 * 保存绑卡订单实体
	 * 
	 * @author wangjwy
	 * @date 2018/6/5 10:55
	 * @since 2.2.0
	 * @param record
	 * @return int
	 * @throws Exception
	 */
	int insert(ProtocolBindingOrderDO record);

	/**
	 * 更新订单状态
	 * 
	 * @author wangjwy
	 * @date 2018/6/5 11:04
	 * @since 2.2.0
	 * @param busiId, state, originState, respCode, respDesc, protocolCode
	 * @return int
	 * @throws Exception
	 */
	int modifyState(@Param("busiId") String busiId, @Param("state") Integer state, @Param("originState") Integer originState,
			@Param("respCode") Integer respCode, @Param("respDesc") String respDesc, @Param("protocolCode") String protocolCode);

	/**
	 * 根据主键查询订单
	 * 
	 * @author wangjwy
	 * @date 2018/6/5 16:21
	 * @since 2.2.0
	 * @param busiId
	 * @return com.yyfax.pay.order.model.domain.ProtocolUntieOrderDO
	 * @throws Exception
	 */
	ProtocolBindingOrderDO selectByPrimaryKey(@Param("busiId") String busiId);

	/**
	 * 根据订单号和商户号查询
	 * 
	 * @author wangjwy
	 * @date 2018/6/14 10:58
	 * @since 2.2.0
	 * @param merchantCode, orderId
	 * @return com.yyfax.pay.order.model.domain.ProtocolBindingOrderDO
	 * @throws Exception
	 */
	ProtocolBindingOrderDO selectByMerchantCodeAndOrderId(@Param("merchantCode") String merchantCode, @Param("orderId") String orderId);
}